package com.example.jsd2205.vx.emos.db.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;
/*
* @author admin 兰
* 映射message集合
* */
@Data
@Document(collection = "message")
public class MessageEntity implements Serializable {
    @Id
    private String _id;
///自动生成的主键值
    @Indexed(unique = true)
    private String uuid;
//防止消息被重复消费
    @Indexed
    private Integer senderId;
//发送者ID 就是用户ID 如果是系统自动发出,这个ID值为0
    private String senderPhoto="https://static-1258386385.cos.ap-beijing.myqcloud.com/img/System.jpg";
//发送者的头像URL
    private String senderName;
//发送者的名称
    private String msg;
//消息正文
    @Indexed
    private Date sendTime;
}//发送时间
